<template>
  <div class="find">
      <find-header :findList="findImg"></find-header>
      <find-list></find-list>
      <find-content :findList2="findList2"></find-content>
      <find-nav :navList="navList"></find-nav>
  </div>
</template>

<script>
import axios from 'axios'
import FindHeader from './components/FindHeader'
import FindList from './components/FindList'
import FindContent from './components/FindContent'
import FindNav from './components/FindNav'
export default {
  name: 'Find',
  data () {
    return {
        navList:[],
        findImg:[],
        findList2:{}
    }
  },
  components:{
    FindHeader,
    FindList,
    FindContent,
    FindNav 
  },mounted(){
    this.getHomeInfo()
  },
  methods:{
    getHomeInfo(){
        // axios返回的结果是一个promise对象
        axios.get('/shopping_mall/index.php/Home/Find/index').then(
        // 注意：这里绝对不可以写成this.getHomeInfoSucc（），否则请求的结果会是undefined
        this.getHomeInfoSucc
      )
    },
    getHomeInfoSucc(res){
        // console.log(res)
        res = res.data 
        // console.log(res)
        if(res.ret && res.data){
          this.findImg  = res.data.findImg
          this.findList2 = res.data.findList2
          this.navList = res.data.navList
        }
    }
  }
}
</script>


<style lang="stylus" scoped>
.find
    background-color #efefef
</style>
